Integrand size = 30, antiderivative size = 84 \[ \int (a+b \cos (c+d x)) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {1}{2} (b B+a C) x+\frac {(3 a B+2 b C) \sin (c+d x)}{3 d}+\frac {(b B+a C) \cos (c+d x) \sin (c+d x)}{2 d}+\frac {b C \cos ^2(c+d x) \sin (c+d x)}{3 d} \]
1/2*(B*b+C*a)*x+1/3*(3*B*a+2*C*b)*sin(d*x+c)/d+1/2*(B*b+C*a)*cos(d*x+c)*si n(d*x+c)/d+1/3*b*C*cos(d*x+c)^2*sin(d*x+c)/d
Time = 0.16 (sec) , antiderivative size = 75, normalized size of antiderivative = 0.89 \[ \int (a+b \cos (c+d x)) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {6 b B c+6 a c C+6 b B d x+6 a C d x+3 (4 a B+3 b C) \sin (c+d x)+3 (b B+a C) \sin (2 (c+d x))+b C \sin (3 (c+d x))}{12 d} \]
(6*b*B*c + 6*a*c*C + 6*b*B*d*x + 6*a*C*d*x + 3*(4*a*B + 3*b*C)*Sin[c + d*x ] + 3*(b*B + a*C)*Sin[2*(c + d*x)] + b*C*Sin[3*(c + d*x)])/(12*d)
Time = 0.34 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.29, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {3042, 3502, 3042, 3213}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (a+b \cos (c+d x)) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right ) \left (B \sin \left (c+d x+\frac {\pi }{2}\right )+C \sin \left (c+d x+\frac {\pi }{2}\right )^2\right )dx\) |
\(\Big \downarrow \) 3502 |
\(\displaystyle \frac {\int (a+b \cos (c+d x)) (2 b C+(3 b B-a C) \cos (c+d x))dx}{3 b}+\frac {C \sin (c+d x) (a+b \cos (c+d x))^2}{3 b d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right ) \left (2 b C+(3 b B-a C) \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx}{3 b}+\frac {C \sin (c+d x) (a+b \cos (c+d x))^2}{3 b d}\) |
\(\Big \downarrow \) 3213 |
\(\displaystyle \frac {\frac {\left (a^2 (-C)+3 a b B+2 b^2 C\right ) \sin (c+d x)}{d}+\frac {b (3 b B-a C) \sin (c+d x) \cos (c+d x)}{2 d}+\frac {3}{2} b x (a C+b B)}{3 b}+\frac {C \sin (c+d x) (a+b \cos (c+d x))^2}{3 b d}\) |
(C*(a + b*Cos[c + d*x])^2*Sin[c + d*x])/(3*b*d) + ((3*b*(b*B + a*C)*x)/2 + ((3*a*b*B - a^2*C + 2*b^2*C)*Sin[c + d*x])/d + (b*(3*b*B - a*C)*Cos[c + d *x]*Sin[c + d*x])/(2*d))/(3*b)
3.8.71.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.) *(x_)]), x_Symbol] :> Simp[(2*a*c + b*d)*(x/2), x] + (-Simp[(b*c + a*d)*(Co s[e + f*x]/f), x] - Simp[b*d*Cos[e + f*x]*(Sin[e + f*x]/(2*f)), x]) /; Free Q[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Co s[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Simp[1/(b*(m + 2)) Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && !LtQ[m, -1]
Time = 0.81 (sec) , antiderivative size = 65, normalized size of antiderivative = 0.77
method | result | size |
parallelrisch | \(\frac {3 \left (B b +a C \right ) \sin \left (2 d x +2 c \right )+b \sin \left (3 d x +3 c \right ) C +3 \left (4 B a +3 C b \right ) \sin \left (d x +c \right )+6 \left (B b +a C \right ) x d}{12 d}\) | \(65\) |
parts | \(\frac {\left (B b +a C \right ) \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {a B \sin \left (d x +c \right )}{d}+\frac {C b \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3 d}\) | \(70\) |
derivativedivides | \(\frac {\frac {C b \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+B b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a C \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B a \sin \left (d x +c \right )}{d}\) | \(85\) |
default | \(\frac {\frac {C b \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+B b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a C \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B a \sin \left (d x +c \right )}{d}\) | \(85\) |
risch | \(\frac {b B x}{2}+\frac {a C x}{2}+\frac {a B \sin \left (d x +c \right )}{d}+\frac {3 b C \sin \left (d x +c \right )}{4 d}+\frac {\sin \left (3 d x +3 c \right ) C b}{12 d}+\frac {\sin \left (2 d x +2 c \right ) B b}{4 d}+\frac {\sin \left (2 d x +2 c \right ) a C}{4 d}\) | \(85\) |
norman | \(\frac {\left (\frac {B b}{2}+\frac {a C}{2}\right ) x +\left (\frac {B b}{2}+\frac {a C}{2}\right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {3 B b}{2}+\frac {3 a C}{2}\right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {3 B b}{2}+\frac {3 a C}{2}\right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {\left (2 B a -B b -a C +2 C b \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {\left (2 B a +B b +a C +2 C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {4 \left (3 B a +C b \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}\) | \(179\) |
1/12*(3*(B*b+C*a)*sin(2*d*x+2*c)+b*sin(3*d*x+3*c)*C+3*(4*B*a+3*C*b)*sin(d* x+c)+6*(B*b+C*a)*x*d)/d
Time = 0.30 (sec) , antiderivative size = 60, normalized size of antiderivative = 0.71 \[ \int (a+b \cos (c+d x)) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {3 \, {\left (C a + B b\right )} d x + {\left (2 \, C b \cos \left (d x + c\right )^{2} + 6 \, B a + 4 \, C b + 3 \, {\left (C a + B b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{6 \, d} \]
1/6*(3*(C*a + B*b)*d*x + (2*C*b*cos(d*x + c)^2 + 6*B*a + 4*C*b + 3*(C*a + B*b)*cos(d*x + c))*sin(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 170 vs. \(2 (76) = 152\).
Time = 0.12 (sec) , antiderivative size = 170, normalized size of antiderivative = 2.02 \[ \int (a+b \cos (c+d x)) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\begin {cases} \frac {B a \sin {\left (c + d x \right )}}{d} + \frac {B b x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {B b x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {B b \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {C a x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {C a x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {C a \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {2 C b \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {C b \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a + b \cos {\left (c \right )}\right ) \left (B \cos {\left (c \right )} + C \cos ^{2}{\left (c \right )}\right ) & \text {otherwise} \end {cases} \]
Piecewise((B*a*sin(c + d*x)/d + B*b*x*sin(c + d*x)**2/2 + B*b*x*cos(c + d* x)**2/2 + B*b*sin(c + d*x)*cos(c + d*x)/(2*d) + C*a*x*sin(c + d*x)**2/2 + C*a*x*cos(c + d*x)**2/2 + C*a*sin(c + d*x)*cos(c + d*x)/(2*d) + 2*C*b*sin( c + d*x)**3/(3*d) + C*b*sin(c + d*x)*cos(c + d*x)**2/d, Ne(d, 0)), (x*(a + b*cos(c))*(B*cos(c) + C*cos(c)**2), True))
Time = 0.25 (sec) , antiderivative size = 79, normalized size of antiderivative = 0.94 \[ \int (a+b \cos (c+d x)) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} C a + 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B b - 4 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} C b + 12 \, B a \sin \left (d x + c\right )}{12 \, d} \]
1/12*(3*(2*d*x + 2*c + sin(2*d*x + 2*c))*C*a + 3*(2*d*x + 2*c + sin(2*d*x + 2*c))*B*b - 4*(sin(d*x + c)^3 - 3*sin(d*x + c))*C*b + 12*B*a*sin(d*x + c ))/d
Time = 0.32 (sec) , antiderivative size = 68, normalized size of antiderivative = 0.81 \[ \int (a+b \cos (c+d x)) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {1}{2} \, {\left (C a + B b\right )} x + \frac {C b \sin \left (3 \, d x + 3 \, c\right )}{12 \, d} + \frac {{\left (C a + B b\right )} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac {{\left (4 \, B a + 3 \, C b\right )} \sin \left (d x + c\right )}{4 \, d} \]
1/2*(C*a + B*b)*x + 1/12*C*b*sin(3*d*x + 3*c)/d + 1/4*(C*a + B*b)*sin(2*d* x + 2*c)/d + 1/4*(4*B*a + 3*C*b)*sin(d*x + c)/d
Time = 1.76 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.00 \[ \int (a+b \cos (c+d x)) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {B\,b\,x}{2}+\frac {C\,a\,x}{2}+\frac {B\,a\,\sin \left (c+d\,x\right )}{d}+\frac {3\,C\,b\,\sin \left (c+d\,x\right )}{4\,d}+\frac {B\,b\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {C\,a\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {C\,b\,\sin \left (3\,c+3\,d\,x\right )}{12\,d} \]